package Reports;


import java.awt.EventQueue;


public class ReportMain
{
	private static ConnectionDB con;

	/***
	 * 
	 * @param args
	 */
	public static void main(String[] args)
	{
		conectToDatabase();
		openReportFrame();
	}

	private static void conectToDatabase()
	{
//		String	driver = "org.mariadb.jdbc.Driver";
//		String	url = "jdbc:mariadb://localhost:3306/";
//		String	db	= "inventory";
		String	driver = "com.mysql.jdbc.Driver";
		String	url = "jdbc:mysql://srv:3306/";
		String	db	= "dbmarket";
		
		con = new ConnectionDB( driver, db, url );
		con.connect();
	}

	private static void openReportFrame()
	{
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ReportFrame frame = new ReportFrame( con.getConn() );
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

}
